/* eslint-disable spaced-comment */
/* eslint-disable no-multi-spaces */
/* eslint-disable eol-last */

// 预设layout参数
export const layoutSet = (span = 24) => ({
  span,
  responsive: false,
  // md: span,
  // sm: span,
  // xs: span,
  offset: 0,
  push: 0,
  pull: 0
})

export const units = [
  // 容器组件
  {
    groupName: 'container',
    title: '容器',
    units: [
      {
        title: '栅格',
        type: 'grid',
        group: 'container',
        icon: 'grid',
        cols: [],
        options: {
          name: '',
          gutter: 10,
          unitClass: '',
        }
      },
      // {
      //   title: '标签页',
      //   type: 'tab',
      //   group: 'container',
      //   icon: 'tab',
      //   tabs: [],
      //   options: {
      //     name: '',
      //     hidden: false,
      //     unitClass: ''
      //   }
      // },
      {
        title: '卡片',
        type: 'card',
        group: 'container',
        icon: 'card',
        options: {
          name: '',
          label: 'card',
          folded: false,
          showFold: true,
          customClass: '',
        }
      },
    ]
  },
  // 基础组件
  {
    groupName: 'basicFields',
    title: '基础组件',
    units: [
      // 输入框
      {
        title: '输入框',
        type: 'input',
        group: 'field',
        icon: 'text-field',
        formItemFlag: true,
        options: {
          name: '',
          label: 'input',
          labelAlign: '',
          type: 'text',
          defaultValue: '',
          placeholder: '',
          columnWidth: '200px',
          size: '',
          labelWidth: null,
          labelHidden: false,
          readonly: false,
          disabled: false,
          hidden: false,
          clearable: true,
          showPassword: false,
          required: false,
          requiredHint: '',
          validation: '',
          validationHint: '',
          //-------------------
          customClass: '',  // 自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          minLength: null,
          maxLength: null,
          showWordLimit: false,
          prefixIcon: '',
          suffixIcon: '',
          appendButton: false,
          appendButtonDisabled: false,
          buttonIcon: 'el-icon-search',
          //-------------------
          onListener: '',
          onCreated: '',
          onMounted: '',
          onInput: '',
          onChange: '',
          onFocus: '',
          onBlur: '',
          onValidate: '',
          onAppendButtonClick: '',
        },
      },
      // 多行文本输入框
      {
        title: '多行输入框',
        type: 'textarea',
        icon: 'textarea-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: 'textarea',
          labelAlign: '',
          autosize: false,
          rows: 3,
          defaultValue: '',
          placeholder: '',
          columnWidth: '200px',
          size: '',
          labelWidth: null,
          labelHidden: false,
          readonly: false,
          disabled: false,
          hidden: false,
          required: false,
          requiredHint: '',
          validation: '',
          validationHint: '',
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          minLength: null,
          maxLength: null,
          showWordLimit: false,
          //-------------------
          onCreated: '',
          onMounted: '',
          onInput: '',
          onChange: '',
          onFocus: '',
          onBlur: '',
          onValidate: '',
        },
      },
      // 计数器
      {
        title: '计数器',
        type: 'number',
        icon: 'number-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: 'number',
          labelAlign: '',
          defaultValue: 0,
          placeholder: '',
          columnWidth: '200px',
          size: '',
          labelWidth: null,
          labelHidden: false,
          disabled: false,
          hidden: false,
          required: false,
          requiredHint: '',
          validation: '',
          validationHint: '',
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          min: -100000000000,
          max: 100000000000,
          precision: 0,
          step: 1,
          controlsPosition: 'right',
          //-------------------
          onCreated: '',
          onMounted: '',
          onChange: '',
          onFocus: '',
          onBlur: '',
          onValidate: '',
        },
      },
      // 单选组
      {
        title: '单选组',
        type: 'radio',
        icon: 'radio-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: 'radio',
          labelAlign: '',
          defaultValue: null,
          columnWidth: '200px',
          size: '',
          displayStyle: 'inline',
          buttonStyle: false,
          border: false,
          labelWidth: null,
          labelHidden: false,
          disabled: false,
          hidden: false,
          optionItems: [
            { label: 'radio 1', value: 1 },
            { label: 'radio 2', value: 2 },
            { label: 'radio 3', value: 3 },
          ],
          optionItemsAsync: '',
          required: false,
          requiredHint: '',
          validation: '',
          validationHint: '',
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          //-------------------
          onCreated: '',
          onMounted: '',
          onChange: '',
          onValidate: '',
        },
      },
      // 复选组
      {
        title: '复选组',
        type: 'checkbox',
        icon: 'checkbox-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: 'checkbox',
          labelAlign: '',
          defaultValue: [],
          columnWidth: '200px',
          size: '',
          displayStyle: 'inline',
          buttonStyle: false,
          border: false,
          labelWidth: null,
          labelHidden: false,
          disabled: false,
          hidden: false,
          optionItems: [
            { label: 'check 1', value: 1 },
            { label: 'check 2', value: 2 },
            { label: 'check 3', value: 3 },
          ],
          optionItemsAsync: '',
          required: false,
          requiredHint: '',
          validation: '',
          validationHint: '',
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          //-------------------
          onCreated: '',
          onMounted: '',
          onChange: '',
          onValidate: '',
        },
      },
      // 下拉选择
      {
        title: '下拉选择',
        type: 'select',
        icon: 'select-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: 'select',
          labelAlign: '',
          defaultValue: null,
          placeholder: '',
          columnWidth: '200px',
          size: '',
          labelWidth: null,
          labelHidden: false,
          disabled: false,
          hidden: false,
          clearable: true,
          filterable: false,
          allowCreate: false,
          remote: false,
          automaticDropdown: false,  //自动下拉
          multiple: false,
          multipleLimit: 0,
          optionItems: [
            { label: 'select 1', value: 1 },
            { label: 'select 2', value: 2 },
            { label: 'select 3', value: 3 },
          ],
          optionItemsAsync: '',
          required: false,
          requiredHint: '',
          validation: '',
          validationHint: '',
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          //-------------------
          onCreated: '',
          onMounted: '',
          onRemoteQuery: '',
          onChange: '',
          onFocus: '',
          onBlur: '',
          onValidate: '',
        },
      },
      // 日期
      {
        title: '日期',
        type: 'date',
        icon: 'date-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: 'date',
          labelAlign: '',
          type: 'date',
          defaultValue: null,
          placeholder: '',
          columnWidth: '200px',
          size: '',
          labelWidth: null,
          labelHidden: false,
          readonly: false,
          disabled: false,
          hidden: false,
          clearable: true,
          editable: false,
          format: 'yyyy-MM-dd',  //日期显示格式
          valueFormat: 'yyyy-MM-dd',  //日期对象格式
          required: false,
          requiredHint: '',
          validation: '',
          validationHint: '',
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          //-------------------
          onCreated: '',
          onMounted: '',
          onChange: '',
          onFocus: '',
          onBlur: '',
          onValidate: '',
        },
      },
      // 日期范围
      {
        title: '日期范围',
        type: 'date-range',
        icon: 'date-range-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: 'date-range',
          labelAlign: '',
          type: 'daterange',
          defaultValue: null,
          startPlaceholder: '',
          endPlaceholder: '',
          columnWidth: '200px',
          size: '',
          labelWidth: null,
          labelHidden: false,
          readonly: false,
          disabled: false,
          hidden: false,
          clearable: true,
          editable: false,
          format: 'yyyy-MM-dd',  //日期显示格式
          valueFormat: 'yyyy-MM-dd',  //日期对象格式
          required: false,
          requiredHint: '',
          validation: '',
          validationHint: '',
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          //-------------------
          onCreated: '',
          onMounted: '',
          onChange: '',
          onFocus: '',
          onBlur: '',
          onValidate: '',
        },
      },
      // 开关
      {
        title: '开关',
        type: 'switch',
        icon: 'switch-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: 'switch',
          labelAlign: '',
          defaultValue: null,
          columnWidth: '200px',
          labelWidth: null,
          labelHidden: false,
          disabled: false,
          hidden: false,
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          switchWidth: 40,
          activeText: '',
          inactiveText: '',
          activeColor: null,
          inactiveColor: null,
          //-------------------
          onCreated: '',
          onMounted: '',
          onChange: '',
          onValidate: '',
        },
      },
      // 静态文字
      {
        title: '静态文字',
        type: 'static-text',
        icon: 'static-text',
        group: 'static',
        formItemFlag: false,
        options: {
          name: '',
          columnWidth: '200px',
          backgroundColor: '#ffffff00',
          textColor: '#666666ff',
          hidden: false,
          textContent: 'static text',
          textAlign: 'left',
          fontSize: '13px',
          preWrap: false,  //是否自动换行
          //-------------------
          customClass: '',  //自定义css类名
          //-------------------
          onCreated: '',
          onMounted: '',
        },
      },
      // HTML代码块
      {
        title: 'HTML',
        type: 'html-text',
        icon: 'html-text',
        group: 'field',
        formItemFlag: false,
        options: {
          name: '',
          columnWidth: '200px',
          hidden: false,
          htmlContent: '<b>html text</b>',
          //-------------------
          customClass: '',  //自定义css类名
          //-------------------
          onCreated: '',
          onMounted: '',
        },
      },
      // 按钮
      {
        title: '按钮',
        type: 'button',
        icon: 'button',
        group: 'field',
        formItemFlag: false,
        options: {
          name: '',
          label: 'button',
          buttonLabel: 'button',
          columnWidth: '200px',
          size: '',
          displayStyle: 'block',
          labelWidth: null,
          labelHidden: false,
          disabled: false,
          hidden: false,
          buttonType: 'primary',
          perviewShow: false,
          renderShow: true,
          plain: false,
          round: false,
          circle: false,
          icon: null,
          //-------------------
          customClass: '',  //自定义css类名
          //-------------------
          onCreated: '',
          onMounted: '',
          onClick: '',
        },
      },
      // 分割线
      {
        title: '分割线',
        type: 'divider',
        icon: 'divider',
        group: 'static',
        formItemFlag: false,
        options: {
          name: '',
          label: '',
          columnWidth: '200px',
          direction: 'horizontal',
          contentPosition: 'center',
          hidden: false,
          //-------------------
          customClass: '',  //自定义css类名
          //-------------------
          onCreated: '',
          onMounted: '',
        },
      },
      // 表格
      {
        title: '表格',
        type: 'table',
        icon: 'table',
        group: 'field',
        options: {
          name: '',
          label: "",
          defaultRowValue: '',
          rowEnabled: true,
          'tableTopLabel': '',
          'tableTopBgcolor': '#ffffff00',
          'tableTopLabelPadding': '0 8px',
          'tableTopLabelAlign': 'center',
          'textColor': '#909399',
          hidden: false,
          border: true,
          "tableSize": 'small',
          "highLightCurrentRow": true,
          unitClass: '',
          "tableCols": [],
        }
      },
    ]
  },
  // 高级组件
  {
    groupName: 'advancedFields',
    title: '高级组件',
    units: [
      // 图片上传
      {
        title: '图片上传',
        type: 'picture-upload',
        icon: 'picture-upload-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: '',
          labelAlign: '',
          labelWidth: null,
          labelHidden: false,
          columnWidth: '200px',
          disabled: false,
          hidden: false,
          required: false,
          requiredHint: '',
          customRule: '',
          customRuleHint: '',
          //-------------------
          defaultValue: [],
          uploadURL: '',
          uploadTip: '',
          withCredentials: false,
          multipleSelect: false,
          showFileList: true,
          limit: 3,
          fileMaxSize: 5, //MB
          fileTypes: ['jpg', 'jpeg', 'png'],
          //headers: [],
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          //-------------------
          onCreated: '',
          onMounted: '',
          onBeforeUpload: '',
          onUploadSuccess: '',
          onUploadError: '',
          onFileRemove: '',
          onValidate: '',
          //onFileChange: '',
        },
      },
      // 文件上传
      {
        title: '文件上传',
        type: 'file-upload',
        icon: 'file-upload-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: '',
          labelAlign: '',
          labelWidth: null,
          labelHidden: false,
          columnWidth: '200px',
          disabled: false,
          hidden: false,
          required: false,
          requiredHint: '',
          customRule: '',
          customRuleHint: '',
          //-------------------
          defaultValue: [],
          uploadURL: '',
          uploadTip: '',
          withCredentials: false,
          multipleSelect: false,
          showFileList: true,
          limit: 3,
          fileMaxSize: 5, //MB
          fileTypes: ['doc', 'docx', 'xls', 'xlsx'],
          //headers: [],
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          //-------------------
          onCreated: '',
          onMounted: '',
          onBeforeUpload: '',
          onUploadSuccess: '',
          onUploadError: '',
          onFileRemove: '',
          onValidate: '',
          //onFileChange: '',
        },
      },
      // 富文本
      {
        title: '富文本',
        type: 'rich-editor',
        icon: 'rich-editor-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: '',
          labelAlign: '',
          placeholder: '',
          labelWidth: null,
          labelHidden: false,
          columnWidth: '200px',
          disabled: false,
          hidden: false,
          required: false,
          requiredHint: '',
          customRule: '',
          customRuleHint: '',
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          minLength: null,
          maxLength: null,
          showWordLimit: false,
          //-------------------
          onCreated: '',
          onMounted: '',
          onValidate: '',
        },
      },
      // 联级选择器
      {
        title: '联级选择器',
        type: 'cascader',
        icon: 'cascader-field',
        group: 'field',
        formItemFlag: true,
        options: {
          name: '',
          label: '',
          labelAlign: '',
          defaultValue: '',
          placeholder: '',
          size: '',
          labelWidth: null,
          labelHidden: false,
          columnWidth: '200px',
          disabled: false,
          hidden: false,
          clearable: true,
          filterable: false,
          multiple: false,
          checkStrictly: false,  //可选择任意一级选项，默认不开启
          showAllLevels: true,  //显示完整路径
          optionItems: [
            { label: 'select 1', value: 1, children: [{ label: 'child 1', value: 11 }] },
            { label: 'select 2', value: 2 },
            { label: 'select 3', value: 3 },
          ],
          optionItemsAsync: '',
          required: false,
          requiredHint: '',
          customRule: '',
          customRuleHint: '',
          //-------------------
          customClass: '',  //自定义css类名
          labelIconClass: null,
          labelIconPosition: 'rear',
          labelTooltip: null,
          //-------------------
          onCreated: '',
          onMounted: '',
          onChange: '',
          onFocus: '',
          onBlur: '',
          onValidate: '',
        },
      },
    ]
  },
  // 自定义组件
  // {
  //   groupName: 'customFields',
  //   title: '自定义组件',
  //   units: [

  //   ]
  // }
]